<template>
  <div>
    <button @click="goback">返回</button>
    <div>
      {{list.productInfo || list.productInfo1 ||list.productInfo2}}
    </div>
  </div>
</template>

<script>
import obj from "../../api/api";
export default {
  data() {
    return {
      list: [],
    };
  },
  props: ['id'],
  mounted() {
    this.listData();
    console.log(this.id)
  },
//   watch: {
//     $root: "listData",
//   },
  methods: {
    listData() {
      let id = this.$route.query.id;
      fetch(obj.api + `/getmoneyctrlproduct?productid=${this.id}`)
        .then((res) => {
          return res.json();
        })
        .then((res) => {
          this.list = res.result[0];
          console.log(res.result[0]);
        });
    },
    goback() {
      this.$router.push({ path: "/home" });
    },
  },
};
</script>

<style></style>
